// mock/user.ts
function createUserList() {
  return [
    {
      userId: 1,
      avatar: "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      username: "admin",
      password: "111111",
      desc: "\u5E73\u53F0\u7BA1\u7406\u5458",
      roles: ["\u5E73\u53F0\u7BA1\u7406\u5458"],
      buttons: ["cuser.detail"],
      routes: ["home"],
      token: "Admin Token"
    },
    {
      userId: 2,
      avatar: "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      username: "system",
      password: "111111",
      desc: "\u7CFB\u7EDF\u7BA1\u7406\u5458",
      roles: ["\u7CFB\u7EDF\u7BA1\u7406\u5458"],
      buttons: ["cuser.detail", "cuser.user"],
      routes: ["home"],
      token: "System Token"
    }
  ];
}
var user_default = [
  //  用户登录接口
  {
    url: "/api/user/login",
    method: "post",
    response: ({ body }) => {
      const { username, password } = body;
      const checkUser = createUserList().find(
        (item) => item.username === username && item.password === password
      );
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: "\u8D26\u53F7\u5BC6\u7801\u4E0D\u6B63\u786E"
          }
        };
      }
      const { token } = checkUser;
      return {
        code: 200,
        data: {
          token
        }
      };
    }
  },
  // 获取用户信息接口
  {
    url: "/api/user/info",
    method: "get",
    response: (request) => {
      const token = request.headers.token;
      const checkUser = createUserList().find((item) => {
        return item.token === token;
      });
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: "\u83B7\u53D6\u7528\u6237\u4FE1\u606F\u5931\u8D25"
          }
        };
      }
      return {
        code: 200,
        data: {
          checkUser
        }
      };
    }
  }
];
export {
  user_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibW9jay91c2VyLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX2luamVjdGVkX2ZpbGVuYW1lX18gPSBcIkM6XFxcXFVzZXJzXFxcXDg2MTM1XFxcXERlc2t0b3BcXFxcYmFja3N0YWdlL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Y3JlYXRlVXNlckxpc3QoKS5maW5kKFxyXG4gICAgICAgICAgICAgICAgKGl0ZW0pPT5pdGVtLnVzZXJuYW1lID09PSB1c2VybmFtZSAmJiBpdGVtLnBhc3N3b3JkID09PSBwYXNzd29yZFxyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgLy8gICAgIFx1NkNBMVx1NjcwOVx1NzUyOFx1NjIzN1x1OEZENFx1NTZERVx1NTkzMVx1OEQyNVx1NEZFMVx1NjA2RlxyXG4gICAgICAgICAgICBpZighY2hlY2tVc2VyKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IDIwMSxcclxuICAgICAgICAgICAgICAgICAgICBkYXRhOntcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTonXHU4RDI2XHU1M0Y3XHU1QkM2XHU3ODAxXHU0RTBEXHU2QjYzXHU3ODZFJ1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIC8vICAgICBcdTY3MDlcdTUyMTlcdThGRDRcdTU2REVcdTYyMTBcdTUyOUZcdTRGRTFcdTYwNkZcclxuICAgICAgICAgICAgY29uc3Qge3Rva2VufSA9IGNoZWNrVXNlclxyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgY29kZToyMDAsXHJcbiAgICAgICAgICAgICAgICBkYXRhOntcclxuICAgICAgICAgICAgICAgICAgICB0b2tlblxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIC8vIFx1ODNCN1x1NTNENlx1NzUyOFx1NjIzN1x1NEZFMVx1NjA2Rlx1NjNBNVx1NTNFM1xyXG4gICAge1xyXG4gICAgICAgIHVybDonL2FwaS91c2VyL2luZm8nLFxyXG4gICAgICAgIG1ldGhvZDonZ2V0JyxcclxuICAgICAgICByZXNwb25zZToocmVxdWVzdCkgPT4ge1xyXG4gICAgICAgIC8vICAgICBcdTgzQjdcdTUzRDZcdThCRjdcdTZDNDJcdTU5MzRcdTY0M0FcdTVFMjZ0b2tlblxyXG4gICAgICAgICAgICBjb25zdCB0b2tlbiA9IHJlcXVlc3QuaGVhZGVycy50b2tlblxyXG4gICAgICAgIC8vICAgICBcdTY3RTVcdTc3MEJcdTc1MjhcdTYyMzdcdTRGRTFcdTYwNkZcdTY2MkZcdTU0MjZcdTUzMDVcdTU0MkJcdTY3MDlcdTZCMjF0b2tlblx1NzUyOFx1NjIzN1xyXG4gICAgICAgICAgICBjb25zdCBjaGVja1VzZXIgPSBjcmVhdGVVc2VyTGlzdCgpLmZpbmQoKGl0ZW0pPT57XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gaXRlbS50b2tlbiA9PT0gdG9rZW5cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgaWYoIWNoZWNrVXNlcikge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgICAgICBjb2RlOiAyMDEsXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YTp7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6J1x1ODNCN1x1NTNENlx1NzUyOFx1NjIzN1x1NEZFMVx1NjA2Rlx1NTkzMVx1OEQyNSdcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICBjb2RlOiAyMDAsXHJcbiAgICAgICAgICAgICAgICBkYXRhOntcclxuICAgICAgICAgICAgICAgICAgICBjaGVja1VzZXJcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXSBhcyBNb2NrTWV0aG9kW10iXSwKICAibWFw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